Raspberry 4 can be used with either a 32-bit armv7l/armhf operating system (usually Raspbian) or a 64-bit aarch64 OS like Debian, Ubuntu, Arch or 64-bit Raspbian.
When using a 32-bit Raspbian the installation is done as for Raspberry Pi 2/3 For 64-bit aarch64/amd64 OSes Opencpn is installed using Flatpak, there is no difference to using desktop OSes like Ubuntu or Fedora. See Flatpak
You can also use OpenCPN in Raspberry 4 using OpenPlotter for 32bit or 64bit: https://openplotter.readthedocs.io/en/latest/
64-bit Raspbian suffers from https://bugs.launchpad.net/raspbian/+bug/1972041. This affects users running 64-bit Raspbian on headless systems without monitor. The root cause is a bug in the RealVNC server that comes bundled with Raspbian. Possible works-arounds includes to use TightVNC or tigervnc instead, both of which available through Debian repositories using tools like apt(8).
Android on RPI 4 -LineageOS 19 for Raspberry Pi 4 Model B, Pi 400, and Compute Module 4